<?php
/*
 * @Author: CHINAKAIYUAN<sunkaiyuan@namenode.cn>
 * @Date: 2022-02-03 00:33:05
 * @LastEditTime: 2023-11-05 16:01:55
 * @LastEditors: 孙开源 && sunkaiyuan@namenode.cn
 * @Description: 
 */

namespace App\Models;



class PurchaseComplaint extends PurchaseStorage
    {
    /**
     * 标识
     *
     * @var string
     */
    protected $ACSign = 'PURCHASE_COMPLAINT';
    protected $_instorage_way_id = 4;
    public function details()
        {
        return $this->hasMany(PurchaseComplaintDetails::class, "main_id");
        }

    public function complaint()
        {
        return $this->belongsTo(Dic::class, "complaint_id", "key")->where(function ($q)
            {
            $q->where("code", 'Complaint');
            });
        }
    }